#pragma once

#include <QObject>
#include<qserialport.h>
#include <QVector>
#include <qqueue.h>
#include <QTimer>



class DataProcess : public QObject
{
	Q_OBJECT

public:
	DataProcess(QObject *parent);
	~DataProcess();
	QVector<QString> DataProcess::getPortNames();
	bool open(QString boxName);
	void close();
	bool checkPortStatus(QString boxName);
	void sendSlot(QString str);
	void readPortSlot();
	void getQueueData(QByteArray &data);
    void StringToHex(QString str, QByteArray &senddata);
	char ConverHexChar(char ch);

private:
	QSerialPort *port;
	QQueue<QByteArray> m_queue;
	//bool checkPortStatus(QString boxName);
	//bool m_serialOpen;

signals:
	void readPortFinished();
};
